﻿@{
    ViewBag.Title = "Handvn-Quản lý sản phẩm";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model IEnumerable<handvn.Models.Product>
@if (Request.IsAuthenticated)
{
     <div class="tl_content_qly_prod">
   <h2>
        QUẢN LÝ SẢN PHẨM</h2>

    <p style="padding-left:20px">
        @Html.ActionLink("THÊM MỚI SẢN PHẨM", "UserCreate")
    </p>

    <table border="2px solid #cfcfcf">
    <tr>
        <th style="width:200px">
            Tên sản phẩm
        </th>
        <th>
            Giá sản phẩm
        </th>
       
        <th>
            Hình ảnh
        </th>
        <th>
            Giới thiệu
        </th>
        <th>
            Số lượng
        </th>

        <th>
            Chi tiết danh mục
        </th>
        
        <th>
            Tình trạng
        </th>
        <th>Quản trị</th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td style="width:200px">
            @Html.DisplayFor(modelItem => item.TenSanPham)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.GiaSanPham)
        </td>
        @*<td>
            @Html.DisplayFor(modelItem => item.GiaThiTruong)
        </td>*@
        <td style="width:200px">
            @Html.DisplayFor(modelItem => item.HinhAnh)
        </td>
        <td class="tl_item_gioithieu">
            @Html.DisplayFor(modelItem => item.GioiThieu)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.SoLuong)
        </td>
        
        <td>
            @Html.DisplayFor(modelItem => item.DetailCategories.TenChiTietDanhMuc)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TinhTrang)
        </td>
        <td>
            @Html.ActionLink("Sửa", "UserEdit", new { id = item.ProductID }) |
            @Html.ActionLink("Chi tiết", "UserDetails", new { id = item.ProductID }) |
            @Html.ActionLink("Xóa", "UserDelete", new { id = item.ProductID })
        </td>
    </tr>
}

</table>
</div>
}
else
{
    <div class="tl_content" style="text-align:center">
    <p>
         XIN VUI LÒNG ĐĂNG NHẬP</p>
    @Html.ActionLink("Đăng nhập", "Login", "Account")
    </div>
}